package com.lyf.lottery.controller;


import com.github.pagehelper.PageInfo;
import com.lyf.common.api.CommonPage;
import com.lyf.common.api.CommonResult;
import com.lyf.lottery.controller.assembler.OptActivityBlindBoxRecordAssembler;
import com.lyf.lottery.model.po.OptActivityBlindBoxRecord;
import com.lyf.lottery.model.req.OptActivityBlindBoxRecordQuery;
import com.lyf.lottery.model.vo.*;
import com.lyf.lottery.service.OptActivityBlindBoxRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 *  OptActivityBlindBoxRecord 接口
 * @author lyf
 **/
@RestController
@Api(tags = "OptActivityBlindBoxRecord接口")
@RequestMapping("/optActivity/")
public class OptActivityBlindBoxRecordController {

	@Autowired
	private OptActivityBlindBoxRecordService optActivityBlindBoxRecordService;


	@GetMapping("blindBoxRecord/list")
	@ApiOperation("获取列表")
	public CommonResult<CommonPage<OptActivityBlindBoxRecordVo>> selectPage(OptActivityBlindBoxRecordQueryVo optActivityBlindBoxRecordQueryVo) {
		OptActivityBlindBoxRecordQuery query = OptActivityBlindBoxRecordAssembler.INSTANCE.getOptActivityBlindBoxRecordQuery(optActivityBlindBoxRecordQueryVo);
		PageInfo<OptActivityBlindBoxRecord> pageInfo = optActivityBlindBoxRecordService.selectPage(query);
		PageInfo<OptActivityBlindBoxRecordVo> resultPage = OptActivityBlindBoxRecordAssembler.INSTANCE.convertPageInfo(pageInfo);
		return CommonResult.success(CommonPage.restPage(resultPage));
	}

}

